/*
 * @author				: Juliano Zinni
 * @create				: 17/10/2011
 * @description			: Página responsável por exibir ajuda ao usuário
*/


var functionsAjuda = {
	
	teste: function(){
		alert()
	}	
		
}


var tabConteudoAjuda = new Ext.TabPanel({
	region : "center",
	enableTabScroll : true,
	activeTab : 0,
	defaults : {
		closable : true
	},
	items : [ {
		autoScroll : true,
		title : "Ajuda",
		html : "<table width='420' border='0' class='titulo'><tr><td width='355' height='140' valign='middle'><h1>Ajuda e Suporte do SIAD</h1><p>Para obter ajuda, navegue pelo menu lateral.</p></td><td width='150' align='right' valign='top'><span style='height:300px'><img src='img/question.png' align='right'></span></td></tr><tr height='175' valign='bottom'><td>&nbsp;</td><td><span style='height:300px'><img src='img/ieadc.png' width='139' height='45' align='right'></span></td></tr></table>",
		bodyStyle : "padding:10px;",
		iconCls : "silk-question",
		closable : false
	} ]
});


var menuAjuda = new Ext.ux.tree.RemoteTreePanel( {
	id : "menuAjuda",
	region : "west",
	width : 148,
	autoScroll : true,
	animate : true,
	containerScroll : true,
	dataUrl : "help/menuAjuda.json",
	rootVisible : false,
	root : {
		nodeType : "async"
	},
	minSize : 148,
	maxSize : 300,
	split : true,
	editable : false,
	contextMenu : false,
	listeners : {
		scope : this
		//click : this.onNodeClick
	},
	
	tbar : [ {
		xtype : "textfield",
		width : 145,
		emptyText : "Procurar",
		enableKeyEvents : true
		/*
		listeners : {
			scope : this,
			keyup : {
				buffer : 150,
				fn : function(c, b) {
					var d = c.getRawValue();
					var a = new RegExp(".*" + d + ".*",
							"i");
					this.menuAjuda.filter.clear();
					this.menuAjuda.filter.filter(a,
							"text")
				}
			}
		}
		*/
	} ]
	
});



var windowAjuda = new Ext.Window({
	title: 'Ajuda do Sistema'
	, width: 800
	, height: 500
	, items: [menuAjuda, tabConteudoAjuda]
	, layout: 'fit'
	, modal: true
	, closeAction:'hide'
});

function writeAjuda(){
	windowAjuda.show();
}